
const findSon = (arr, id = '') => {
  const resultArr = []
  arr.forEach(item => {
    if (item.pid === id) {
      resultArr.push(item)
      const children = findSon(arr, item.id)
      if (children.length) {
        item.children = children
      }
    }
  })

  //   console.log(resultArr)
  return resultArr
}
export default findSon
